#! /usr/bin/env python2.5

def main():
    for i in range(2,10):
        for j in range(1,i):
            for k in range(1,10):
                if (j*10+k)*i==(i*10+k)*j:
                    print j,k,i,k
                if (k*10+j)*i == (i*10+k)*j:
                    print k,j,i,k
                if (j*10+k)*i == (k*10+i)*j:
                    print j,k,k,i
                if (k*10+j)*i == (k*10+i)*j:
                    print k,i,k,j





if __name__ == '__main__':
    main()
                
